#include <stdio.h>
#include "itpack2d.h"

int main()
{
  int N=5, NDIM=5, MAXNZ=3, ITMAX=100, NW=6*N+4*ITMAX,
    LEVEL=1;
  int IWKSP[3*N], IPARM[12],IER;
  int JCOEF[3][5]=
    {
      1, 0, 3, 4, 5,
      4, 2, 0, 1, 1,
      5, 0, 0, 5, 4,
    };
  float COEF[3][5]= 
    {
      11.,  0., 33., 44., 55.,
      14.,  22.,  0., 14., 15.,
      15.,  0.,  0., 45., 45.,
    };
  float RHS[5] = {1, 2, 3, 4, 5};
  float U[5], zero=0;
  float WKSP[NW];
  float RPARM[12];
  
  dfault_(IPARM, RPARM);
  IPARM[0] = ITMAX;
  IPARM[1] = LEVEL;
  IPARM[4] = 2; // nonsymmetic
  IPARM[11] = 1; //print both solution and residual vectors;
  vfill_(&N,U,&zero);
  //jcg_(&N, &NDIM, &MAXNZ, JCOEF[0], COEF[0], RHS, U,
  //     IWKSP, &NW, WKSP, IPARM, RPARM, &IER);
  ssorcg_(&N, &NDIM, &MAXNZ, JCOEF[0], COEF[0], RHS, U,
       IWKSP, &NW, WKSP, IPARM, RPARM, &IER);

  return 0;
}

  
	    
